Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update list.php #30254

Merged
merged 7 commits into from
Jul 16, 2024
Merged

Update list.php #30254

merged 7 commits into from
Jul 16, 2024

Conversation

elfibro
Copy link
Contributor

@elfibro elfibro commented Jul 3, 2024

Added condition to include client code in the search when the global variable SOCIETE_ADD_REF_IN_LIST is set to 1.

  • Modified the SQL query to include 's.code_client' in the search conditions.
  • Added check for the global variable SOCIETE_ADD_REF_IN_LIST.
  • If SOCIETE_ADD_REF_IN_LIST is 1, 's.code_client' is included in the search along with 's.nom' and 's.name_alias'.
  • Ensured that 's.code_client' is searched separately only when SOCIETE_ADD_REF_IN_LIST is 1 and 'search_societe' is not defined.

Instructions

This is a template to help you make good pull requests. You may use Github Markdown syntax to format your issue report.
Please:

  • only keep the "FIX", "CLOSE", "NEW", "PERF" or "QUAL" section (use uppercase to have the PR appears into the ChangeLog, lowercase will not appears)
  • follow the project contributing guidelines
  • replace the bracket enclosed texts with meaningful information

FIX|Fix #[issue_number Short description]

[Long description]

CLOSE|Close #[issue_number Short description]

[Long description]

NEW|New [Short description]

[Long description]

PERF|Perf #[issue_number Short description]

[Long description]

QUAL|Qual #[issue_number Short description]

[Long description]

Added condition to include client code in the search when the global variable SOCIETE_ADD_REF_IN_LIST is set to 1.

- Modified the SQL query to include 's.code_client' in the search conditions.
- Added check for the global variable SOCIETE_ADD_REF_IN_LIST.
- If SOCIETE_ADD_REF_IN_LIST is 1, 's.code_client' is included in the search along with 's.nom' and 's.name_alias'.
- Ensured that 's.code_client' is searched separately only when SOCIETE_ADD_REF_IN_LIST is 1 and 'search_societe' is not defined.
@elfibro elfibro closed this Jul 3, 2024
@elfibro elfibro reopened this Jul 3, 2024
@@ -635,16 +635,29 @@
if ($search_availability) {
$sql .= " AND p.fk_availability IN (".$db->sanitize($db->escape($search_availability)).')';
}
$societe_add_ref_in_list = (!empty($conf->global->SOCIETE_ADD_REF_IN_LIST) ? $conf->global->SOCIETE_ADD_REF_IN_LIST : 0); // Récupérer la valeur de SOCIETE_ADD_REF_IN_LIST
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you replace conf->global->xxx with getDolGlobalString('xxx
Old syntax is no more allowed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's ok now

@eldy eldy added the PR to fix - See feedback in comments PR needs to be fixed to be integrated (some comments should describes the fix to do) label Jul 4, 2024
Refactor: Replace conf->global->SOCIETE_ADD_REF_IN_LIST with getDolGlobalString('SOCIETE_ADD_REF_IN_LIST')
@elfibro elfibro requested a review from eldy July 8, 2024 15:52
@@ -635,16 +635,29 @@
if ($search_availability) {
$sql .= " AND p.fk_availability IN (".$db->sanitize($db->escape($search_availability)).')';
}
$societe_add_ref_in_list = (!empty(getDolGlobalString('SOCIETE_ADD_REF_IN_LIST')) ? getDolGlobalString('SOCIETE_ADD_REF_IN_LIST') : 0); // Récupérer la valeur de SOCIETE_ADD_REF_IN_LIST
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$societe_add_ref_in_list = getDolGlobalInt('SOCIETE_ADD_REF_IN_LIST'); is more simple and pass the tests

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's ok now

Simplified SOCIETE_ADD_REF_IN_LIST retrieval

Replaced conditional retrieval with getDolGlobalInt('SOCIETE_ADD_REF_IN_LIST') to simplify code and pass tests.
@eldy eldy changed the base branch from 20.0 to develop July 16, 2024 12:53
@eldy eldy merged commit 1983c09 into Dolibarr:develop Jul 16, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR to fix - See feedback in comments PR needs to be fixed to be integrated (some comments should describes the fix to do)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants